package com.testdocs.client.project.dashboard;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.testdocs.client.signin.context.RequiresSignIn;
import com.testdocs.client.structure.menu.MenuItem;
import com.testdocs.client.structure.menu.RequiresMenuSelection;

public class DashboardPlace extends Place implements RequiresSignIn, RequiresMenuSelection {
	private String projectId;
	
	public DashboardPlace(String projectId) {
		this.projectId = projectId;
	}
	
	public String getProjectId() {
		return projectId;
	}
	
    public static class Tokenizer implements PlaceTokenizer<DashboardPlace> {
        @Override
        public String getToken(DashboardPlace place) {
            return place.getProjectId();
        }

        @Override
        public DashboardPlace getPlace(String token) {
            return new DashboardPlace(token);
        }
    }

	@Override
	public MenuItem getMenuItem() {
		return MenuItem.DASHBOARD;
	}
}
